package com.tensquare.gathering.dao;

import com.tensquare.gathering.pojo.Gathering;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author Alfred
 * @description TODO
 * @date 2021/4/26 9:31
 */
public interface GatheringDao extends JpaRepository<Gathering,String>, JpaSpecificationExecutor<Gathering> {
    /**
     * fetch data by rule id
     *
     * @description  根据城市显示分页
     * @param
     * @return
     */
    @Query("select g from Gathering as g where g.city=?1")
    public Page<Gathering> findListByCity(String city, Pageable pageable);
}
